<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.red {
				color: red;
			}
			.fonsize {
				font-size: 40px;
			}
			.wh {
				height: 100px;
			}
			.wh {
				width: 100px;
				background-color: aquamarine;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<!-- 注意类名后面的属性值不能加引号 -->
			
			<!-- 对象表示 -->
			<div :class="{red: isred, fonsize: issize}">中国</div>
			<button type="button" @click="change">切换</button>
			
			<!-- 数组表示 -->
			<div :class="[wheight, wwidth]"></div>
		</div>
		<script src="vue.js"></script>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					isred: true,
					issize: true,
				  wheight: 'wh',
					wwidth: 'ww'
				},
				methods: {
					change() {
						this.isred = !this.isred
					}
				}
			})
		</script>
	</body>
</html>

